<!-- include tpl=head_lay title=$title -->
<form method="post" class="layui-form" id="post_save" onsubmit="return $.admin_gateway.save()">
<!-- if $id -->
<input type="hidden" name="id" id="id" value="{$id}" />
<!-- else -->
<input type="hidden" name="code" id="code" value="{$code}" />
<input type="hidden" name="type" id="type" value="{$type}" />
<!-- /if -->
<div class="layui-card">
	<div class="layui-card-header">
		<!-- if $id -->{lang编辑网关路由信息}<!-- else -->{lang添加配置网关路由信息}<!-- /if -->
		<span class="red">{$extlist.title}</span>
	</div>
	<div class="layui-card-body">
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang名称}
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="title" name="title" class="layui-input" value="{$rs.title}" />
			</div>
			<div class="layui-form-mid">
				{lang请针对当前网关设置一个名称以方便管理}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang状态}
			</label>
			<div class="layui-input-inline auto">
				<input type="radio" name="status" value="1"{if $rs.status} checked{/if} title="{lang启用}" />
				<input type="radio" name="status" value="0"{if !$rs.status} checked{/if} title="{lang禁用}" />
			</div>
			<div class="layui-form-mid">
				{lang只有启用此项，前台才能有效使用网关}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang默认}
			</label>
			<div class="layui-input-inline auto">
				<input type="radio" name="is_default" value="1"{if $rs.is_default} checked{/if} title="{lang是}" />
				<input type="radio" name="is_default" value="0"{if !$rs.is_default} checked{/if} title="{lang否}" />
			</div>
			<div class="layui-form-mid">
				{lang设置此网关是否默认使用，一种类型的网关仅支持一个默认}
			</div>
		</div>

	    <!-- loop from=$extlist.code key=$key value=$value -->
	    <!-- php:$valinfo = $rs['ext'][$key] ? $rs['ext'][$key] : $value.default -->
	    <div class="layui-form-item">
	    	<label class="layui-form-label">
	    		{$value.title}
	    	</label>
	    	<div class="layui-input-block">
	    		<!-- if $value.type == 'radio' -->
	    			<!-- loop from=$value.option key=$k value=$v -->
                    <input type="radio" name="{$code}_{$key}" value="{$k}"{if $valinfo == $k} checked{/if} title="{$v}" />
                    <!-- /loop -->
	            <!-- elseif $value.type == 'select' -->
		            <select name="{$code}_{$key}" id="{$code}_{$key}">
		                <option value="">{lang请选择…}</option>
		                <!-- loop from=$value.option key=$k value=$v -->
		                <option value="{$k}"{if $valinfo == $k} selected{/if}>{$v}</option>
		                <!-- /loop -->
		            </select>
	            <!-- elseif $value.type == 'checkbox' -->
	            	<!-- php:$valinfo = $valinfo ? explode(',',$valinfo) : array() -->
                    <!-- loop from=$value.option key=$k value=$v -->
                    <input type="checkbox" name="{$code}_{$k}" value="{$k}"{if in_array($k,$valinfo)} checked{/if} title="{$v}" />
                    <!-- /loop -->
	            <!-- elseif $value.type == 'password' -->
	            	<input type="password" id="{$code}_{$key}" name="{$code}_{$key}" class="layui-input" value="{$valinfo}" />
	            <!-- else -->
	            	<!-- php:$input_name = $code.'_'.$key -->
		            <!-- if $value.typebtn == 'file' -->
		            {func form_edit $input_name $valinfo text form_btn=file&width=500}
		            <!-- elseif $value.typebtn == 'image' -->
		            {func form_edit $input_name $valinfo text form_btn=image&width=500}
		            <!-- elseif $value.typebtn == 'video' -->
		            {func form_edit $input_name $valinfo text form_btn=video&width=500}
		            <!-- else -->
		            <input type="text" id="{$code}_{$key}" name="{$code}_{$key}" class="layui-input" value="{$valinfo}" />
		            <!-- /if -->
	            <!-- /if -->
	    	</div>
	    	<!-- if $value.note || $value.required == 'true' -->
	    	<div class="layui-input-block mtop">
		    	{$value.note}<!-- if $value.required == 'true' --> <span class="red">(此项必填)</span><!-- /if -->
	    	</div>
	    	<!-- /if -->
	    </div>
	    <!-- /loop -->
	    <div class="layui-form-item">
	    	<label class="layui-form-label">
	    		{lang排序}
	    	</label>
	    	<div class="layui-input-inline short">
	    		<input type="text" id="taxis" name="taxis" class="layui-input" value="{$rs.taxis}" />
	    	</div>
	    	<div class="layui-form-mid">
	    		{lang值范围在0-255，越小越往前靠，默认为255}
	    	</div>
	    </div>
	    <div class="layui-form-item">
	    	<label class="layui-form-label">
		    	<i class="layui-icon layui-tips" lay-tips="{lang填写该网关路由使用的注意事项}">&#xe702;</i>
	    		{lang摘要说明}
	    	</label>
	    	<div class="layui-input-block">
	    		{func form_edit note $rs.note editor width=700&height=300&etype=simple&btn_image=1}
	    	</div>
	    </div>
		
	</div>
</div>
<div class="submit-info-clear"></div>
<div class="submit-info">
	<div class="layui-container center">
		<input type="submit" value="{lang提交}" class="layui-btn layui-btn-lg layui-btn-danger" />
		<input type="button" value="{lang取消关闭}" class="layui-btn layui-btn-lg layui-btn-primary" onclick="$.admin.close()" />
	</div>
</div>
</form>
<!-- include tpl=foot -->

